package org.pasta.bean;

import java.util.List;

import org.pasta.common.AbstractBean;
import org.pasta.query.CustomerQuery;
import org.pasta.service.CustomerServices;
import org.pasta.data.Customer;

public class CustomerBean extends AbstractBean implements CustomerServices {
	
	private CustomerQuery customerQuery;

	public CustomerBean(List queryList) {
		super(queryList);
		if( queryList != null && queryList.size() > 0 ){
			Object obj = queryList.get(0);
			if( obj instanceof CustomerQuery ){
				customerQuery = (CustomerQuery)obj;
			}
		}
	}

	public List<Customer> findCustomers(String searchTxt) {
		// TODO Auto-generated method stub
		return customerQuery.findCustomers(searchTxt);
	}

	public CustomerQuery getCustomerQuery() {
		return customerQuery;
	}

	public void setCustomerQuery(CustomerQuery customerQuery) {
		this.customerQuery = customerQuery;
	}

}
